package com.ceba.test.modules.invalid.entity;

import com.ceba.base.web.entity.IBase;
import com.ceba.test.base.language.ResourceUtils;

public class ReportInvalid extends IBase{

	/**
	 * 
	 */
	private static final long serialVersionUID = -2799629368350175800L;

	private String id;
	
	private String reportId;
	
	//颁发者名称
	private String issuer;
	
	//颁发者机构
	private String issuerO;
	
	//证书持有者名称
	private String subject;
	
	//证书持有者组织
	private String subjectO;
	
	//文档签名时间
	private String signTime;
	
	//有效期起始时间
	private String validStartTime;
	
	//有效期结束时间
	private String validEndTime;
	
	//签名文档的结果--是否被修改且证书是否有效
	private String veriResult;
	
	//系列号
	private String objectId;
	
	//算法
	private String alg;
	
	  /*
     * code =1 表示无签名证书；code=2 私人签名 ；
     * code=3 第三方CA签名 ；
     * code=4 验证失败；
     * code=0 成功 ；
     * code=5 证书过期，签名不受Adobe保护
     * code = 6  顶级root证书不受信，其子证书存在授信，可能由于本地证书不存在或者文件名错误或者被其他证书以相同文件名覆盖，导致顶级root证书不受信 ，发送邮件到服务器，提醒修改---==code=3
     * code = 7  顶级root证书，不存在trust属性，可能该顶级证书不存在于本地证书目录中，需要手动导出证书到本地目录  -- == code=3
     * code = 8  顶级root证书授信，但其子证书有不受信的存在，发送邮件提醒导入中级证书 ---== code = 0
     * code = 9  顶级root证书 ，不存在trust属性，但其子证书中存在授信的情况 ---- code = 3
     * code = 10 若库中存在颁发者的issuer_cn或者issuer_o,无其颁发者密钥，可能该机构存在多个下发的证书，需要补全该密钥标识，发送邮件提醒--code = 3
     * code = 11 成功的情况，证书不受Adboe信任，但受CNCA信任
     * code = 12 多签名即certificates>1时，验证成功的情况，被adobe工具修改后的和原文档解析相同，modify=false有多个的情况，文档肯定是ok的
     * code = 13 数字证书被损害，certifacates为空串 code = 1
     * code = 14 第三方可疑情况时，证书不受Adobe信任，但受CNCA信任
     * code = 15 多签名情况，验证成功的情况，证书不受Adobe信任，受CNCA信任
     * code = 16 即受Adobe信任同时受CNCA信任
     */
	private int code;
	
	//文档名称，特指作废文档的名称
	private String fileName;
	
	//受信状态字符串
	private String trustState;
	
	//公钥个数
	private int cerNum;
	
	//0，授信  ；1 不受信；2无该属性
	private int trustFlay;  
	
	//作废文档ID，特指作废报告
	private String invalidFileId;
	
	//附件1文件ID
	private String annex1FileId;
	
	//附件2文件ID
	private String annex2FileId;
	
	//作废理由
	private String reason;
	
	//文档审批的状态:0未通过，1通过，2待审批
	private String status;
	
	//文档哈希值
	private String fileHash;
		
	public static String NOTPASS= "0";
	
	public static String PASS= "1";
	
	public static String FORPASS= "2";
	
	//上传人IP
	private String uploadUserIp;
	
	private String creatTime;
	
	private String creatUser;
	

	public String getId() {
		return id;
	}

	public String getReportId() {
		return reportId;
	}

	public void setReportId(String reportId) {
		this.reportId = reportId;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getIssuer() {
		return issuer;
	}

	public void setIssuer(String issuer) {
		this.issuer = issuer;
	}

	public String getIssuerO() {
		return issuerO;
	}

	public void setIssuerO(String issuerO) {
		this.issuerO = issuerO;
	}

	public String getSubject() {
		return subject;
	}

	public void setSubject(String subject) {
		this.subject = subject;
	}

	public String getSubjectO() {
		return subjectO;
	}

	public void setSubjectO(String subjectO) {
		this.subjectO = subjectO;
	}

	public String getSignTime() {
		return signTime;
	}

	public void setSignTime(String signTime) {
		this.signTime = signTime;
	}

	public String getValidStartTime() {
		return validStartTime;
	}

	public void setValidStartTime(String validStartTime) {
		this.validStartTime = validStartTime;
	}

	public String getValidEndTime() {
		return validEndTime;
	}

	public void setValidEndTime(String validEndTime) {
		this.validEndTime = validEndTime;
	}

	public String getVeriResult() {
		return veriResult;
	}

	public void setVeriResult(String veriResult) {
		this.veriResult = veriResult;
	}

	public String getObjectId() {
		return objectId;
	}

	public void setObjectId(String objectId) {
		this.objectId = objectId;
	}

	public String getAlg() {
		return alg;
	}

	public void setAlg(String alg) {
		this.alg = alg;
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public String getFileName() {
		return fileName;
	}

	public void setFileName(String fileName) {
		this.fileName = fileName;
	}

	public String getTrustState() {
		return trustState;
	}

	public void setTrustState(String trustState) {
		this.trustState = trustState;
	}

	public int getCerNum() {
		return cerNum;
	}

	public void setCerNum(int cerNum) {
		this.cerNum = cerNum;
	}

	public int getTrustFlag() {
		return trustFlay;
	}

	public void setTrustFlag(int trustFlag) {
		this.trustFlay = trustFlag;
	}

	public String getInvalidFileId() {
		return invalidFileId;
	}

	public void setInvalidFileId(String invalidFileId) {
		this.invalidFileId = invalidFileId;
	}

	public String getAnnex1FileId() {
		return annex1FileId;
	}

	public void setAnnex1FileId(String annex1FileId) {
		this.annex1FileId = annex1FileId;
	}

	public String getAnnex2FileId() {
		return annex2FileId;
	}

	public void setAnnex2FileId(String annex2FileId) {
		this.annex2FileId = annex2FileId;
	}

	public String getReason() {
		return reason;
	}

	public void setReason(String reason) {
		this.reason = reason;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getFileHash() {
		return fileHash;
	}

	public void setFileHash(String fileHash) {
		this.fileHash = fileHash;
	}

	public String getUploadUserIp() {
		return uploadUserIp;
	}

	public void setUploadUserIp(String uploadUserIp) {
		this.uploadUserIp = uploadUserIp;
	}

	public String getCreatTime() {
		return creatTime;
	}

	public void setCreatTime(String creatTime) {
		this.creatTime = creatTime;
	}

	public String getCreatUser() {
		return creatUser;
	}

	public void setCreatUser(String creatUser) {
		this.creatUser = creatUser;
	}

	
	public static String getStatusByValue(String value) {
		if( "NotPass".equals(value)){
			value = NOTPASS;
		}else if("Pass".equals(value)){
			value = PASS;
		}else if("ForPass".equals(value)){
			value = FORPASS;
		}else{
			value = "";
		}
		return value;
	}

	public static String getStatusByIntValue(String value) {
		if( "0".equals(value)){
			value = ResourceUtils.getMessage("MODULES_NOT_THROUGH");
		}else if("1".equals(value)){
			value = ResourceUtils.getMessage("MOBILE_ADOPT");
		}else if("2".equals(value)){
			value = ResourceUtils.getMessage("MOBILE_TO_BE_AUDITED");
		}
		return value;
	}

	
	public static String getLogByChangeStatus(String oldStatus, String nowStatus) {
		if("0".equals(oldStatus)){
			oldStatus = ResourceUtils.getMessage("MODULES_NOT_THROUGH");
		}else if("1".equals(oldStatus)){
			oldStatus = ResourceUtils.getMessage("MOBILE_ADOPT");
		}else if("2".equals(oldStatus)){
			oldStatus = ResourceUtils.getMessage("MOBILE_TO_BE_AUDITED");
		}
		if("0".equals(nowStatus)){
			nowStatus = ResourceUtils.getMessage("MODULES_NOT_THROUGH");
		}else if("1".equals(nowStatus)){
			nowStatus = ResourceUtils.getMessage("MOBILE_ADOPT");
		}else if("2".equals(nowStatus)){
			nowStatus = ResourceUtils.getMessage("MOBILE_TO_BE_AUDITED");
		}
		
		return oldStatus+"--->"+nowStatus;
	}
	
	
	
	
	
	
}
